<%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/3/20 16:40
  description: Description
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
      integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<html>
<head>
  <title>展示国家列表</title>
</head>
<body>


<h1 align="center">国家信息大全</h1>
<table align="center" style="background-color: aqua" class="table-bordered">
  <div style="text-align: center">
    <form action="${pageContext.request.contextPath}/app/searchCountry">
      <input type="text" name="name" value="">
      <input type="submit" value="搜索">
    </form>
    <hr>
    <a href="${pageContext.request.contextPath}/app/sendAddMessage" style="text-decoration: none">增添国家信息</a>
  </div>

  <tr>
    <td>ID</td>
    <td>Code</td>
    <td>Name</td>
    <td>Region</td>
    <td>SurfaceArea</td>
    <td>IndepYear</td>
    <td>Population</td>
    <td>LifeExpectancy</td>
    <td>GNP</td>
    <td>HeadOfState</td>
    <td>Capital</td>
    <td>Code2</td>
    <td>Function</td>
  </tr>
  <c:forEach items="${list}" var="c" varStatus="status">
    <tr>
      <td>${status.count}</td>
      <td>${c.code}</td>
      <td>${c.name}</td>
      <td>${c.region}</td>
      <td>${c.surfaceArea}</td>
      <td>${c.indepYear}</td>
      <td>${c.population}</td>
      <td>${c.lifeExpectancy}</td>
      <td>${c.gNP}</td>
      <td>${c.headOfState}</td>
      <td>${c.capital}</td>
      <td>${c.code2}</td>
      <td>
        <a href="${pageContext.request.contextPath}/app/showCountryMessage?cname=${c.name}"
           style="text-decoration: none">修改</a>|
        <a href="${pageContext.request.contextPath}/app/deleteCountry?cname=${c.name}"
           onclick="return confirm('确定要删除吗？')" style="text-decoration: none">删除</a>
      </td>
    </tr>
  </c:forEach>
</table>
</body>
</html>
